<script>
export default defineComponent({
  name: 'Icon',
  props: {
    name: {
      type: String,
      required: true
    },
    size: {
      type: [String, Number],
      default: 16
    },
    color: {
      type: String,
      default: 'inherit'
    }
  },
  setup(props) {
    const map = {
      'icon-ep-fold': IconEpFold,
      'icon-ep-expand': IconEpExpand,
      'icon-ep-house': IconEpHouse,
      'icon-ep-plus': IconEpPlus,
      'icon-ep-odometer': IconEpOdometer
    };
    return () => {
      return h(
        ElIcon,
        {
          size: props.size || '16px',
          color: props.color,
          ...props
        },
        () => h(map[props.name])
      );
    };
  }
});
</script>
